<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>房产定制</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
    <link href="public/bootstrap/dist/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="public/xw/css/xcConfirm.css" rel="stylesheet" type="text/css" />
    <script src="public/JQuery.1.11.3.js"></script>
    <script src="public/bootstrap/dist/js/bootstrap.js"></script>
    <script src="public/tool/jquery.placeholder.js"></script>
    <script src="public/tool/jquery.color.js"></script>
    <script src="public/xw/js/xcConfirm.js" type="text/javascript" charset="utf-8"></script>

    <!--[if lt IE 9]>
    <script src="http://apps.bdimg.com/libs/html5shiv/3.7/html5shiv.min.js"></script>
    <script src="http://apps.bdimg.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<script type="text/javascript">
    $(function () {
        // Invoke the plugin
        $('input, textarea').placeholder();
    });
</script>

<style type="text/css">
    .sgBtn{width: 135px; height: 35px; line-height: 35px; margin-left: 10px; margin-top: 10px; text-align: center; background-color: #0095D9; color: #FFFFFF; float: left; border-radius: 5px;}
    .xcConfirm .popBox .ttBox{
        height:50px;
    }
</style>
<link href="public/xw/css/xcConfirm.css" rel="stylesheet" type="text/css" />
<script src="public/xw/js/xcConfirm.js" type="text/javascript" charset="utf-8"></script>
<body>

<!--引入导航条-->
<?php
include 'base/home_header.php';
?>
<style type="text/css">
    .sgBtn{width: 135px; height: 35px; line-height: 35px; margin-left: 10px; margin-top: 10px; text-align: center; background-color: #0095D9; color: #FFFFFF; float: left; border-radius: 5px;}
    .xcConfirm .popBox .ttBox{
        height:50px;
    }
    .top-menu a{
        color: #2b2b2b;
    }
    .second_menu{
        background: whitesmoke;
    }

    .center{
        text-align: center;
    }
    .inputstyle{
        background:none;
        border-top-style: none;
        border-right-style: none;
        border-left-style: none;
        width: 350px;
        height: 34px;
        color: black;
        outline:none;
        line-height: 34px;
        /*font-size: 20px;*/
        padding: 0px;
    }
    :-moz-placeholder { /* Mozilla Firefox 4 to 18 */
        color: #2b2b2b;
        letter-spacing:3px;
        text-indent: 0%;
    }

    ::-moz-placeholder { /* Mozilla Firefox 19+ */
        color: #2b2b2b;
        letter-spacing:3px;
        text-indent: 0%;
    }

    input:-ms-input-placeholder,
    textarea:-ms-input-placeholder {
        color: #2b2b2b;
        letter-spacing:3px;
        text-indent: 0%;
    }

    input::-webkit-input-placeholder,
    textarea::-webkit-input-placeholder {
        color: #2b2b2b;
        letter-spacing:3px;
        text-indent: 0%;
    }
    .header-menu .logo{
        float:left;
        padding-left:120px;
        font-size: 40px;
        color: #2b2b2b;
        letter-spacing: 0px;
        text-shadow: none;
    }
</style>


<div class="row" style="margin-top: 150px;">
    <div class="col-md-12 center">
        <span style="font-size: 40px;">
            填写您希望的房产信息
        </span>
         <span style="color:#262626; ">
             <br>
            最专业的澳洲房地产投资咨询机构,尽心为您寻求最合适的房源
        </span>
    </div>
</div>
<div class="row" style="margin-top: 30px;">
    <div class="col-md-12 center">
        <input id="message_fullname" class="inputstyle" type="text" placeholder="真实姓名"/>
    </div>
</div>
<div class="row" style="margin-top: 30px;">
    <div class="col-md-12 center">
        <input id="message_email" class="inputstyle" type="text" placeholder="常用邮箱"/>
    </div>
</div>
<div class="row" style="margin-top: 30px;">
    <div class="col-md-12 center">
        <input id="message_tel" class="inputstyle" type="text" placeholder="联系电话"/>
    </div>
</div>
<div class="row" style="margin-top: 30px;">
    <div class="col-md-12 center">
        <input id="message_wechat" class="inputstyle" type="text" placeholder="微信"/>
    </div>
</div>
<div class="row" style="margin-top: 30px;">
    <div class="col-md-12 center">
        <input id="message_address" class="inputstyle" type="text" placeholder="目前住址"/>
    </div>
</div>


<div class="row" style="margin-top: 30px;">
    <div class="col-md-8 col-md-offset-3">
        <span>
            选择感兴趣的城市
        </span>
        <br>
        <input id="message_city" type="text" class="form-control" style="width: 80%;"
               placeholder="点击输入">
    </div>
</div>
<div class="row" style="margin-top: 30px;">
    <div class="col-md-8 col-md-offset-3">
        <span>
            输入您期望的房产特性
        </span>
        <br>
        <input id="message_property_like" type="text" class="form-control" style="width: 80%;" placeholder="点击输入,如海景房,农场房等,写下您对房产的期望"/>
    </div>
</div>
<div class="row" style="margin-top: 30px;">
    <div class="col-md-3 col-md-offset-3">
        <span>
           输入您能接受的价格范围
        </span>
        <br>
        <div class="input-group">
            <span class="input-group-addon">￥</span>
            <input id="message_lowest" type="text" class="form-control" placeholder="最低价格">
            <span class="input-group-addon">万元</span>
        </div>

    </div>

    <div class="col-md-3">
        <br>
        <div class="form-group">
            <div class="input-group">
                <span class="input-group-addon">￥</span>
                <input id="message_highest" type="text" class="form-control" placeholder="最高价格">
                <span class="input-group-addon">万元</span>
            </div>
        </div>
    </div>
</div>

<div class="row" style="margin-top: 40px;">
    <div class="col-md-4 col-md-offset-4" style="text-align: center;">
        <button id="btnAdd" class="btn" style="color: white;background: #4CB7C2;text-align: center;width: 150px;">
            提     交
        </button>
    </div>
</div>
<div style="height: 100px;">

</div>
</body>
</html>

<script>

    $(function(){
        $(window).scroll(function(){
            $offset = $('.placeholder').offset();//不能用自身的div，不然滚动起来会很卡
            if($(window).scrollTop()>100){
                $('.header-menu').css({
                    'position':'fixed',
                    'top':'0px',
//                    'left':$offset.left+'px',
                    'z-index':'999',
                    'margin':'auto',
                    'width':'100%',
                    'background':'whitesmoke'
                });
            }else{
                $('.header-menu').removeAttr('style');
            }
        });
    });


    $(document).ready(function(){

        $("#btnAdd").click(function () {
            var message_fullname=$("#message_fullname").val();
            var message_email=$("#message_email").val();
            var message_tel=$("#message_tel").val();
            var message_wechat=$("#message_wechat").val();
            var message_address=$("#message_address").val();
            var message_city=$("#message_city").val();
            var message_property_like=$("#message_property_like").val();
            var message_lowest=$("#message_lowest").val();
            var message_highest=$("#message_highest").val();

            if(message_fullname==""){
                window.wxc.xcConfirm('请输入姓名!', window.wxc.xcConfirm.typeEnum.error);
                return;
            }

            if(message_email==""&&message_tel==""&&message_wechat==""){
                window.wxc.xcConfirm('请输入邮箱,电话,微信中的一项!', window.wxc.xcConfirm.typeEnum.error);
                return;
            }
            
            var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
             if(!reg.test(message_email)){
                 window.wxc.xcConfirm('邮箱格式错误,请重新输入!', window.wxc.xcConfirm.typeEnum.error);
                 return;
             }

            if(!(/^1[3|4|5|7|8]\d{9}$/.test(message_tel)))
            {
                window.wxc.xcConfirm('手机号码格式错误,请重新输入!', window.wxc.xcConfirm.typeEnum.error);
                return;
            }

            if(isNaN(message_lowest)){
                window.wxc.xcConfirm('价格范围请数数字!', window.wxc.xcConfirm.typeEnum.error);
                return;
            }
            if(isNaN(message_highest)){
                window.wxc.xcConfirm('价格范围请数数字!', window.wxc.xcConfirm.typeEnum.error);
                return;
            }
            $.ajax( {
                url: 'class/message/messagefunction.php',
                data:{
                    method:'add',
                    message_fullname : message_fullname,
                    message_email : message_email,
                    message_tel : message_tel,
                    message_wechat : message_wechat,
                    message_address : message_address,
                    message_city : message_city,
                    message_property_like : message_property_like,
                    message_lowest : message_lowest,
                    message_highest : message_highest
                },
                type:'post',
                success:function(data) {
                    if(data==1){
                        window.wxc.xcConfirm('提交成功', window.wxc.xcConfirm.typeEnum.success);
                    }
                },
                beforeSend: function(){

                },
                error : function() {
                    window.wxc.xcConfirm('提交失败', window.wxc.xcConfirm.typeEnum.error);
                }
            });
        });

    });
</script>